inherited fmEnter: TfmEnter
  Left = 68
  Top = 22
  Width = 1292
  Height = 900
  HorzScrollBar.Position = 135
  Caption = #1055#1088#1086#1087#1091#1089#1082
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel [0]
    Left = 230
    Top = 530
    Width = 164
    Height = 16
    Caption = #1054#1073#1098#1077#1076#1080#1085#1077#1085#1085#1099#1077' '#1074' '#1075#1088#1091#1087#1087#1091
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  inherited sbBottom: TStatusBar
    Left = -135
    Top = 830
    Width = 1419
  end
  inherited Panel1: TPanel
    Left = -135
    Top = 785
    Width = 1419
    Align = alBottom
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 1259
    end
    inherited BitBtn2: TBitBtn
      Left = 1347
    end
  end
  object dbgClients: TcxGrid [3]
    Left = 230
    Top = 128
    Width = 588
    Height = 393
    Align = alCustom
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    object tvPeople: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellClick = tvPeopleCellClick
      OnCellDblClick = tvPeopleCellDblClick
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'PP'
          Column = tvPeoplePP
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsBehavior.IncSearchItem = tvPeoplePP
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.CellSelect = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.NavigatorOffset = 10
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object tvPeopleColumn1: TcxGridDBColumn
        Caption = #8470
        OnGetDataText = tvPeopleColumn1GetDataText
        Options.Sorting = False
        Width = 21
      end
      object tvPeoplePP: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'PP'
        Width = 230
      end
      object tvPeoplePDATEBIRTH: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
        DataBinding.FieldName = 'PDATEBIRTH'
        Width = 124
      end
      object tvPeopleSDNAME: TcxGridDBColumn
        Caption = #1057#1090#1072#1090#1091#1089
        DataBinding.FieldName = 'SDNAME'
        Width = 197
      end
    end
    object dbgClientsLevel1: TcxGridLevel
      GridView = tvPeople
    end
  end
  object cxGrid1: TcxGrid [4]
    Left = 230
    Top = 552
    Width = 588
    Height = 265
    Align = alCustom
    TabOrder = 3
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView1: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellClick = cxGridDBTableView1CellClick
      OnCellDblClick = cxGridDBTableView1CellDblClick
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dsRel
      DataController.Summary.DefaultGroupSummaryItems = <
        item
          Kind = skCount
          Position = spFooter
          FieldName = 'PLASTNAME'
        end>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView1Column1: TcxGridDBColumn
        Caption = #8470
        OnGetDataText = cxGridDBTableView1Column1GetDataText
        Options.Sorting = False
        Width = 20
      end
      object cxGridDBTableView1PP: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'PP'
        Width = 232
      end
      object cxGridDBTableView1PDATEBIRTH: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
        DataBinding.FieldName = 'PDATEBIRTH'
        Width = 128
      end
      object cxGridDBTableView1SDNAME: TcxGridDBColumn
        Caption = #1057#1090#1072#1090#1091#1089
        DataBinding.FieldName = 'SDNAME'
        Width = 192
      end
    end
    object cxGridLevel1: TcxGridLevel
      GridView = cxGridDBTableView1
    end
  end
  object cxGrid2: TcxGrid [5]
    Left = 950
    Top = 168
    Width = 316
    Height = 473
    Align = alCustom
    TabOrder = 4
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView2: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellDblClick = cxGridDBTableView2CellDblClick
      DataController.DataModeController.GridMode = True
      DataController.DataSource = dsTemp
      DataController.Summary.DefaultGroupSummaryItems = <
        item
          Kind = skCount
          Position = spFooter
          FieldName = 'PLASTNAME'
        end>
      DataController.Summary.FooterSummaryItems = <>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 10
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView2Column1: TcxGridDBColumn
        Caption = #8470
        OnGetDataText = cxGridDBTableView2Column1GetDataText
        Options.Sorting = False
      end
      object cxGridDBTableView2PP: TcxGridDBColumn
        Caption = #1060#1048#1054
        DataBinding.FieldName = 'PP'
      end
    end
    object cxGridLevel2: TcxGridLevel
      GridView = cxGridDBTableView2
    end
  end
  object cxButton1: TcxButton [6]
    Left = 833
    Top = 184
    Width = 97
    Height = 49
    Caption = #1042#1082#1083'.'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 5
    OnClick = cxButton1Click
    Glyph.Data = {
      56020000424D560200000000000076000000280000001E0000001E0000000100
      040000000000E001000000000000000000001000000000000000000000000000
      8000008000000080800080000000800080008080000080808000C0C0C0000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00000000000000
      00000000000000000000077777777777777777777777777770000F7777777777
      777777777777777770000F8888888888888888888888888770000F8888888888
      888888888888888770000F88888888888888888888888887700A0F8888888888
      8888888888888887702C0F88888888888888888888888887704C0F8888888888
      888888888888888770900F8888888888888888888888888770A80F887F888888
      887F88888888888770150F8878FF88888878FF888888888770420F887008FF88
      887008FF8888888770A60F88700008FF88700008FF88888770000F8870000008
      FF70000008FF888770270F8870000000077000000007788770CA0F8870000007
      787000000778888770A60F8870000778887000077888888770000F8870077888
      887007788888888770250F8877788888887778888888888770CA0F8878888888
      887888888888888770A60F8888888888888888888888888770000F8888888888
      888888888888888770250F8888888888888888888888888770CA0F8888888888
      888888888888888770A60F8888888888888888888888888770000F8888888888
      888888888888888770250F8888888888888888888888888770CA0FFFFFFFFFFF
      FFFFFFFFFFFFFFFF702600000000000000000000000000000000}
    Layout = blGlyphRight
    LookAndFeel.SkinName = 'GlassOceans'
  end
  object cbFindAll: TcxCheckBox [7]
    Left = 585
    Top = 90
    Caption = #1048#1089#1082#1072#1090#1100' '#1074#1089#1077#1093
    ParentFont = False
    Properties.OnChange = cbFindAllPropertiesChange
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 6
    Width = 129
  end
  object cxButton2: TcxButton [8]
    Left = 945
    Top = 714
    Width = 321
    Height = 87
    Caption = #1055#1088#1086#1087#1091#1089#1082
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -32
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 7
    OnClick = cxButton2Click
    LookAndFeel.SkinName = 'GlassOceans'
  end
  object cxButton3: TcxButton [9]
    Left = 617
    Top = 4
    Width = 667
    Height = 64
    Caption = #1042#1093#1086#1076
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -32
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 8
    OnClick = cxButton3Click
    LookAndFeel.Kind = lfFlat
    LookAndFeel.SkinName = ''
  end
  object cxButton4: TcxButton [10]
    Left = -103
    Top = 4
    Width = 697
    Height = 64
    Caption = #1042#1099#1093#1086#1076
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -32
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 9
    OnClick = cxButton4Click
    LookAndFeel.Kind = lfFlat
    LookAndFeel.NativeStyle = False
    LookAndFeel.SkinName = ''
  end
  object edPlan: TcxDBImage [11]
    Left = -119
    Top = 72
    Align = alCustom
    DataBinding.DataField = 'PPIMAGE'
    DataBinding.DataSource = dsPhoto
    Properties.GraphicClassName = 'TJPEGImage'
    Properties.ReadOnly = True
    Style.Shadow = True
    Style.TransparentBorder = True
    TabOrder = 10
    Height = 385
    Width = 337
  end
  object cxButton5: TcxButton [12]
    Left = 837
    Top = 377
    Width = 97
    Height = 56
    Caption = #1048#1089#1082#1083'.'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 11
    OnClick = cxButton5Click
    Colors.Default = clRed
    Glyph.Data = {
      56020000424D560200000000000076000000280000001E0000001E0000000100
      040000000000E001000000000000000000001000000000000000000000000000
      BF0000BF000000BFBF00BF000000BF00BF00BFBF0000C0C0C000808080000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00000000000000
      00000000000000000000088888888888888888888888888880000F8888888888
      888888888888888880000F7777777777777777777777777880000F7777777777
      777777777777777880000F7777777777777777777777777880000F7777777777
      777777777777777880000F7777777777777777777777777880000F7777777777
      777777777777777880000F7777777777777777777777777880000F7777777777
      777777777777777880000F77777777777FF77777777FF77880000F777777777F
      F7F777777FF7F77880000F7777777FF700F7777FF700F77880000F77777FF700
      00F77FF70000F77880000F777FF7000000FFF7000000F77880000F7788000000
      00F800000000F77880000F777788000000F788000000F77880000F7777778800
      00F777880000F77880000F777777778800F777778800F77880000F7777777777
      88F777777788F77880000F777777777777F777777777F77880000F7777777777
      777777777777777880000F7777777777777777777777777880000F7777777777
      777777777777777880000F7777777777777777777777777880000F7777777777
      777777777777777880000F7777777777777777777777777880000FFFFFFFFFFF
      FFFFFFFFFFFFFFFF800000000000000000000000000000000000}
    LookAndFeel.SkinName = 'DarkSide'
  end
  object Panel2: TPanel [13]
    Left = -119
    Top = 467
    Width = 335
    Height = 345
    Caption = #1053#1077#1090' '#1082#1086#1087#1080#1080' '#1087#1072#1089#1087#1086#1088#1090#1072
    Color = clMaroon
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWhite
    Font.Height = -27
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 12
  end
  object cxButton6: TcxButton [14]
    Left = 945
    Top = 655
    Width = 321
    Height = 41
    Caption = #1054#1073#1098#1077#1076'. '#1074' '#1075#1088#1091#1087#1087#1091' '#1089' '#1087#1086#1083#1091#1095'. '#1091#1089#1083#1091#1075
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 13
    OnClick = cxButton6Click
    LookAndFeel.SkinName = 'Caramel'
  end
  object cxButton7: TcxButton [15]
    Left = 929
    Top = 88
    Width = 161
    Height = 49
    Caption = #1054#1073#1085#1086#1074#1080#1090#1100
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 14
    OnClick = cxButton7Click
    Glyph.Data = {
      DE010000424DDE01000000000000760000002800000024000000120000000100
      0400000000006801000000000000000000001000000000000000000000000000
      8000008000000080800080000000800080008080000080808000C0C0C0000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444
      33333333333F7777773F33330000324334222222443333377F3733333377F333
      000032244222222222433337F7733FFFFF337F3300003222222AAAAA22243337
      F333F77777F337F30000322222A33333A2224337F33F7333337F337F00003222
      223333333A224337F33733333337F37F00003222222333333A444337FFFF7F33
      3337777300003AAAAAAA33333333333777777733333333330000333333333333
      333333333333333333FFFFFF000033333333333344444433FFFF333333777777
      00003A444333333A22222437777F333337F3333700003A2243333333A2222437
      F37F333333733337000033A224333334422224337337FFFFF7733337000033A2
      22444442222224337F3377777333FF370000333A2222222222AA243337FF3333
      33FF77F700003333AA222222AA33A3333377FFFFFF7733730000333333AAAAAA
      3333333333337777773333330000333333333333333333333333333333333333
      0000}
    LookAndFeel.SkinName = 'Caramel'
    NumGlyphs = 2
  end
  object Panel3: TPanel [16]
    Left = 953
    Top = 368
    Width = 313
    Height = 115
    TabOrder = 15
    Visible = False
    object cxLookupComboBox2: TcxLookupComboBox
      Left = 6
      Top = 79
      ParentFont = False
      Properties.DropDownListStyle = lsEditList
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'SDNAME'
      Properties.ListColumns = <
        item
          Caption = #1055#1088#1080#1095#1080#1085#1072
          FieldName = 'SDNAME'
        end>
      Properties.ListSource = DataSource5
      EditValue = ''
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.IsFontAssigned = True
      TabOrder = 0
      Width = 299
    end
    object cxButton10: TcxButton
      Left = 4
      Top = 8
      Width = 301
      Height = 65
      Caption = #1055#1088#1080#1095#1080#1085#1072' '#1087#1088#1086#1087#1091#1089#1082#1072
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -21
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 1
      OnClick = cxButton10Click
      LookAndFeel.SkinName = 'Caramel'
    end
  end
  object cxButton8: TcxButton [17]
    Left = 833
    Top = 576
    Width = 97
    Height = 49
    Caption = #1042#1082#1083'.'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 16
    OnClick = cxButton8Click
    Glyph.Data = {
      56020000424D560200000000000076000000280000001E0000001E0000000100
      040000000000E001000000000000000000001000000000000000000000000000
      8000008000000080800080000000800080008080000080808000C0C0C0000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00000000000000
      00000000000000000000077777777777777777777777777770000F7777777777
      777777777777777770000F8888888888888888888888888770000F8888888888
      888888888888888770000F88888888888888888888888887700A0F8888888888
      8888888888888887702C0F88888888888888888888888887704C0F8888888888
      888888888888888770900F8888888888888888888888888770A80F887F888888
      887F88888888888770150F8878FF88888878FF888888888770420F887008FF88
      887008FF8888888770A60F88700008FF88700008FF88888770000F8870000008
      FF70000008FF888770270F8870000000077000000007788770CA0F8870000007
      787000000778888770A60F8870000778887000077888888770000F8870077888
      887007788888888770250F8877788888887778888888888770CA0F8878888888
      887888888888888770A60F8888888888888888888888888770000F8888888888
      888888888888888770250F8888888888888888888888888770CA0F8888888888
      888888888888888770A60F8888888888888888888888888770000F8888888888
      888888888888888770250F8888888888888888888888888770CA0FFFFFFFFFFF
      FFFFFFFFFFFFFFFF702600000000000000000000000000000000}
    Layout = blGlyphRight
    LookAndFeel.SkinName = 'GlassOceans'
  end
  object cxButton9: TcxButton [18]
    Left = 1113
    Top = 88
    Width = 161
    Height = 49
    Caption = #1056#1077#1076#1072#1082#1090'. '#1075#1088#1091#1087#1087
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 17
    OnClick = cxButton9Click
    Glyph.Data = {
      76010000424D7601000000000000760000002800000020000000100000000100
      04000000000000010000120B0000120B00001000000000000000000000000000
      800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
      FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333000000
      000033333377777777773333330FFFFFFFF03FF3FF7FF33F3FF700300000FF0F
      00F077F777773F737737E00BFBFB0FFFFFF07773333F7F3333F7E0BFBF000FFF
      F0F077F3337773F3F737E0FBFBFBF0F00FF077F3333FF7F77F37E0BFBF00000B
      0FF077F3337777737337E0FBFBFBFBF0FFF077F33FFFFFF73337E0BF0000000F
      FFF077FF777777733FF7000BFB00B0FF00F07773FF77373377373330000B0FFF
      FFF03337777373333FF7333330B0FFFF00003333373733FF777733330B0FF00F
      0FF03333737F37737F373330B00FFFFF0F033337F77F33337F733309030FFFFF
      00333377737FFFFF773333303300000003333337337777777333}
    LookAndFeel.SkinName = 'Caramel'
    NumGlyphs = 2
  end
  object cxMaskEdit1: TcxMaskEdit [19]
    Left = 231
    Top = 88
    ParentFont = False
    Properties.OnChange = cxMaskEdit1PropertiesChange
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -19
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 18
    Width = 321
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
    OnDataChange = dlgDSDataChange
    Left = 392
    Top = 240
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'AND UPPER(P.PLASTNAME) LIKE UPPER(:lastname)||'#39'%'#39
      'ORDER BY 3')
    Left = 424
    Top = 240
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'lastname'
        ParamType = ptUnknown
      end>
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPeopleSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object DataSource5: TDataSource
    DataSet = qPropusk
    Left = 1016
    Top = 445
  end
  object qPropusk: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 11'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      ''
      '')
    Left = 1056
    Top = 447
    object qPropuskSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qPropuskSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qPropuskSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qPropuskSDISDELETE: TIntegerField
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object qPInside: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      
        'INNER JOIN P_VIZIT PV1 ON PV1.PID = P.PID AND PV1.PVTIME_IN < CU' +
        'RRENT_TIMESTAMP AND PV1.PVTIME_OUT IS NULL AND PV1.PVPRIZNAK_IN ' +
        'IS NULL AND PV1.PVPRIZNAK_OUT IS NULL'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'AND UPPER(P.PLASTNAME) LIKE UPPER(:lastname)||'#39'%'#39
      'ORDER BY 3')
    Left = 464
    Top = 240
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'lastname'
        ParamType = ptUnknown
      end>
    object qPInsidePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPInsidePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPInsidePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPInsidePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPInsidePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPInsidePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPInsidePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPInsidePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPInsidePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPInsidePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPInsidePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPInsidePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPInsidePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPInsideSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPInsideSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object qPOutside: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '        SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      '    AND NOT EXISTS ('
      'SELECT P1.PID'
      'FROM PEOPLE P1'
      
        'INNER JOIN P_VIZIT PV1 ON PV1.PID = P1.PID AND PV1.PVTIME_IN < C' +
        'URRENT_TIMESTAMP AND PV1.PVTIME_OUT IS NULL AND PV1.PVPRIZNAK_IN' +
        ' IS NULL AND PV1.PVPRIZNAK_OUT IS NULL'
      'WHERE P1.PISDELETE IS NULL'
      '    AND P1.PID = P.PID'
      '    )'
      'AND UPPER(P.PLASTNAME) LIKE UPPER(:lastname)||'#39'%'#39
      'ORDER BY 3')
    Left = 504
    Top = 240
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'lastname'
        ParamType = ptUnknown
      end>
    object IntegerField1: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IBStringField1: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object IBStringField2: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object IBStringField3: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object DateField1: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object IntegerField2: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object IBStringField4: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object IBStringField5: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object DateTimeField1: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object IBStringField6: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object DateTimeField2: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object IntegerField3: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object IBStringField7: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField8: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPOutsideSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object qPhoto: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PP.*'
      'from P_PHOTOS PP'
      'WHERE PP.PID = :pid')
    Left = 296
    Top = 120
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end>
    object qPhotoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_PHOTOS"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPhotoPPIMAGE: TBlobField
      FieldName = 'PPIMAGE'
      Origin = '"P_PHOTOS"."PPIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qPhotoPPNOTE: TIBStringField
      FieldName = 'PPNOTE'
      Origin = '"P_PHOTOS"."PPNOTE"'
      Size = 255
    end
    object qPhotoPPUSERENTER: TIBStringField
      FieldName = 'PPUSERENTER'
      Origin = '"P_PHOTOS"."PPUSERENTER"'
      Size = 40
    end
    object qPhotoPPTIMEENTER: TDateTimeField
      FieldName = 'PPTIMEENTER'
      Origin = '"P_PHOTOS"."PPTIMEENTER"'
    end
    object qPhotoPPUSEREDIT: TIBStringField
      FieldName = 'PPUSEREDIT'
      Origin = '"P_PHOTOS"."PPUSEREDIT"'
      Size = 40
    end
    object qPhotoPPTIMEEDIT: TDateTimeField
      FieldName = 'PPTIMEEDIT'
      Origin = '"P_PHOTOS"."PPTIMEEDIT"'
    end
  end
  object dsPhoto: TDataSource
    DataSet = qPhoto
    Left = 264
    Top = 120
  end
  object qDocuments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT DS.DSID'
      'FROM P_DOCUMENTS PD'
      'INNER JOIN D_SCAN DS ON DS.DID = PD.DID'
      'WHERE PD.PID = :PID'
      '        AND PD.DISDELETE IS NULL'
      '        AND PD.DMAINDOC = 1')
    GeneratorField.Field = 'DID'
    Left = 272
    Top = 512
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qDocumentsDSID: TIntegerField
      FieldName = 'DSID'
      Origin = '"D_SCAN"."DSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
  object dsDocuments: TDataSource
    DataSet = qDocuments
    Left = 248
    Top = 512
  end
  object qTemp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'and p.pid = -1'
      'ORDER BY 3')
    UpdateObject = IBUpdateSQL1
    Left = 1128
    Top = 312
    object qTempPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qTempPNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qTempPLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qTempPPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qTempPDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qTempPSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qTempPNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qTempPUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qTempPTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qTempPUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qTempPTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qTempPISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qTempPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qTempSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qTempSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object dsTemp: TDataSource
    DataSet = qTemp
    OnDataChange = dlgDSDataChange
    Left = 1096
    Top = 312
  end
  object IBUpdateSQL1: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  PNAME,'
      '  PLASTNAME,'
      '  PPATRONYMIC,'
      '  PDATEBIRTH,'
      '  PSEX,'
      '  PNOTE,'
      '  PUSERENTER,'
      '  PTIMEENTER,'
      '  PUSEREDIT,'
      '  PTIMEEDIT,'
      '  PISDELETE,'
      '  PP,'
      '  SDNAME'
      'from PEOPLE '
      'where'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update PEOPLE'
      'set'
      '  PDATEBIRTH = :PDATEBIRTH,'
      '  PID = :PID,'
      '  PISDELETE = :PISDELETE,'
      '  PLASTNAME = :PLASTNAME,'
      '  PNAME = :PNAME,'
      '  PNOTE = :PNOTE,'
      '  PP = :PP,'
      '  PPATRONYMIC = :PPATRONYMIC,'
      '  PSEX = :PSEX,'
      '  PTIMEEDIT = :PTIMEEDIT,'
      '  PTIMEENTER = :PTIMEENTER,'
      '  PUSEREDIT = :PUSEREDIT,'
      '  PUSERENTER = :PUSERENTER,'
      '  SDNAME = :SDNAME'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into PEOPLE'
      
        '  (PDATEBIRTH, PID, PISDELETE, PLASTNAME, PNAME, PNOTE, PP, PPAT' +
        'RONYMIC, '
      '   PSEX, PTIMEEDIT, PTIMEENTER, PUSEREDIT, PUSERENTER, SDNAME)'
      'values'
      
        '  (:PDATEBIRTH, :PID, :PISDELETE, :PLASTNAME, :PNAME, :PNOTE, :P' +
        'P, :PPATRONYMIC, '
      
        '   :PSEX, :PTIMEEDIT, :PTIMEENTER, :PUSEREDIT, :PUSERENTER, :SDN' +
        'AME)')
    DeleteSQL.Strings = (
      'delete from PEOPLE'
      'where'
      '  PID = :OLD_PID')
    Left = 1160
    Top = 312
  end
  object qPVizit: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPVizitAfterInsert
    CachedUpdates = True
    DataSource = dsTemp
    SQL.Strings = (
      'SELECT PV.*'
      'FROM P_VIZIT PV'
      'WHERE PV.PID = :pid'
      '    AND PV.PVTIME_OUT IS NULL'
      '    AND PV.PVTIME_IN IS NOT NULL')
    UpdateObject = quPVizit
    GeneratorField.Field = 'PVID'
    GeneratorField.Generator = 'GEN_P_VIZIT_ID'
    Left = 744
    Top = 754
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qPVizitPVID: TIntegerField
      FieldName = 'PVID'
      Origin = '"P_VIZIT"."PVID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPVizitPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_VIZIT"."PID"'
    end
    object qPVizitPVTARGET: TIntegerField
      FieldName = 'PVTARGET'
      Origin = '"P_VIZIT"."PVTARGET"'
    end
    object qPVizitPVTIME_IN: TDateTimeField
      FieldName = 'PVTIME_IN'
      Origin = '"P_VIZIT"."PVTIME_IN"'
    end
    object qPVizitPVTIME_OUT: TDateTimeField
      FieldName = 'PVTIME_OUT'
      Origin = '"P_VIZIT"."PVTIME_OUT"'
    end
    object qPVizitPVNOTE: TIBStringField
      FieldName = 'PVNOTE'
      Origin = '"P_VIZIT"."PVNOTE"'
      Size = 255
    end
    object qPVizitPVUSERENTER: TIBStringField
      FieldName = 'PVUSERENTER'
      Origin = '"P_VIZIT"."PVUSERENTER"'
      Size = 40
    end
    object qPVizitPVTIMEENTER: TDateTimeField
      FieldName = 'PVTIMEENTER'
      Origin = '"P_VIZIT"."PVTIMEENTER"'
    end
    object qPVizitPVUSEREDIT: TIBStringField
      FieldName = 'PVUSEREDIT'
      Origin = '"P_VIZIT"."PVUSEREDIT"'
      Size = 40
    end
    object qPVizitPVTIMEEDIT: TDateTimeField
      FieldName = 'PVTIMEEDIT'
      Origin = '"P_VIZIT"."PVTIMEEDIT"'
    end
    object qPVizitPVPRIZNAK_IN: TIntegerField
      FieldName = 'PVPRIZNAK_IN'
      Origin = '"P_VIZIT"."PVPRIZNAK_IN"'
    end
    object qPVizitPVPRIZNAK_OUT: TIntegerField
      FieldName = 'PVPRIZNAK_OUT'
      Origin = '"P_VIZIT"."PVPRIZNAK_OUT"'
    end
  end
  object quPVizit: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PVID,'
      '  PID,'
      '  PVTARGET,'
      '  PVTIME_IN,'
      '  PVTIME_OUT,'
      '  PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT,'
      '  PVNOTE,'
      '  PVUSERENTER,'
      '  PVTIMEENTER,'
      '  PVUSEREDIT,'
      '  PVTIMEEDIT'
      'from P_VIZIT '
      'where'
      '  PVID = :PVID')
    ModifySQL.Strings = (
      'update P_VIZIT'
      'set'
      '  PID = :PID,'
      '  PVID = :PVID,'
      '  PVNOTE = :PVNOTE,'
      '  PVPRIZNAK_IN = :PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT = :PVPRIZNAK_OUT,'
      '  PVTARGET = :PVTARGET,'
      '  PVTIME_IN = :PVTIME_IN,'
      '  PVTIME_OUT = :PVTIME_OUT,'
      '  PVTIMEEDIT = :PVTIMEEDIT,'
      '  PVTIMEENTER = :PVTIMEENTER,'
      '  PVUSEREDIT = :PVUSEREDIT,'
      '  PVUSERENTER = :PVUSERENTER'
      'where'
      '  PVID = :OLD_PVID')
    InsertSQL.Strings = (
      'insert into P_VIZIT'
      
        '  (PID, PVID, PVNOTE, PVPRIZNAK_IN, PVPRIZNAK_OUT, PVTARGET, PVT' +
        'IME_IN, '
      '   PVTIME_OUT, PVTIMEEDIT, PVTIMEENTER, PVUSEREDIT, PVUSERENTER)'
      'values'
      
        '  (:PID, :PVID, :PVNOTE, :PVPRIZNAK_IN, :PVPRIZNAK_OUT, :PVTARGE' +
        'T, :PVTIME_IN, '
      
        '   :PVTIME_OUT, :PVTIMEEDIT, :PVTIMEENTER, :PVUSEREDIT, :PVUSERE' +
        'NTER)')
    DeleteSQL.Strings = (
      'delete from P_VIZIT'
      'where'
      '  PVID = :OLD_PVID')
    Left = 776
    Top = 754
  end
  object dsRel: TDataSource
    DataSet = qRel
    OnDataChange = dsRelDataChange
    Left = 424
    Top = 584
  end
  object qRel: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    PS.SDID, P.PDATEBIRTH, SD.SDNAME, P.PID'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC Sd ON sd.SDID = PS.SDID'
      'WHERE'
      'PR.PID_GROUP = ('
      'SELECT DISTINCT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID'
      ')'
      'and P.PISDELETE IS NULL')
    Left = 456
    Top = 584
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qRelPRID: TIntegerField
      FieldName = 'PRID'
      Origin = '"P_REL"."PRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRelPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_REL"."PID"'
    end
    object qRelPID_GROUP: TIntegerField
      FieldName = 'PID_GROUP'
      Origin = '"P_REL"."PID_GROUP"'
    end
    object qRelPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qRelSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
    object qRelPDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qRelSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object qChekGroup: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dsTemp
    SQL.Strings = (
      'SELECT PR.PID'
      'FROM P_REL PR'
      'WHERE PR.PID_GROUP = :PID')
    Left = 1096
    Top = 680
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qChekGroupPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_REL"."PID"'
    end
  end
  object qRelEdit: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP, PS.SDID'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'WHERE PR.PID_GROUP = :PID and P.PISDELETE IS NULL'
      'UNION'
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP, PS.SDID'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'WHERE PR.PID_GROUP IN ('
      'SELECT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID'
      ') and P.PISDELETE IS NULL')
    UpdateObject = quRelEdit
    GeneratorField.Field = 'PRID'
    GeneratorField.Generator = 'GEN_P_REL_ID'
    Left = 1144
    Top = 680
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qRelEditPRID: TIntegerField
      FieldName = 'PRID'
      Origin = '"P_REL"."PRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRelEditPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_REL"."PID"'
    end
    object qRelEditPID_GROUP: TIntegerField
      FieldName = 'PID_GROUP'
      Origin = '"P_REL"."PID_GROUP"'
    end
    object qRelEditPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qRelEditSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object quRelEdit: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PRID,'
      '  PID,'
      '  PID_GROUP,'
      '  PP,'
      '  SDID'
      'from P_REL '
      'where'
      '  PRID = :PRID')
    ModifySQL.Strings = (
      'update P_REL'
      'set'
      '  PID = :PID,'
      '  PID_GROUP = :PID_GROUP,'
      '  PRID = :PRID'
      'where'
      '  PRID = :OLD_PRID')
    InsertSQL.Strings = (
      'insert into P_REL'
      '  (PID, PID_GROUP, PRID)'
      'values'
      '  (:PID, :PID_GROUP, :PRID)')
    DeleteSQL.Strings = (
      'delete from P_REL'
      'where'
      '  PRID = :OLD_PRID')
    Left = 1176
    Top = 682
  end
  object qCheckGroup2: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dsTemp
    SQL.Strings = (
      'SELECT PR.PID_GROUP'
      'FROM P_REL PR'
      'WHERE PR.PID = :PID')
    Left = 1112
    Top = 680
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qCheckGroup2PID_GROUP: TIntegerField
      FieldName = 'PID_GROUP'
      Origin = '"P_REL"."PID_GROUP"'
    end
  end
  object qRelInside: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT UN.*'
      'FROM'
      '('
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    PS.SDID, P.PDATEBIRTH, SD.SDNAME, P.PID AS PID2'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC Sd ON sd.SDID = PS.SDID'
      'WHERE'
      'PR.PID_GROUP = ('
      'SELECT DISTINCT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID '
      ') and P.PISDELETE IS NULL'
      ') AS UN'
      
        'INNER JOIN P_VIZIT PV1 ON PV1.PID = UN.PID2 AND PV1.PVTIME_IN < ' +
        'CURRENT_TIMESTAMP AND PV1.PVTIME_OUT IS NULL AND PV1.PVPRIZNAK_I' +
        'N IS NULL AND PV1.PVPRIZNAK_OUT IS NULL')
    Left = 488
    Top = 584
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object IntegerField4: TIntegerField
      FieldName = 'PRID'
      Origin = '"P_REL"."PRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField5: TIntegerField
      FieldName = 'PID'
      Origin = '"P_REL"."PID"'
    end
    object IntegerField6: TIntegerField
      FieldName = 'PID_GROUP'
      Origin = '"P_REL"."PID_GROUP"'
    end
    object IBStringField9: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object IntegerField7: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
    object DateField2: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object IBStringField10: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object qRelOutside: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT UN1.*'
      'FROM'
      '('
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    PS.SDID, P.PDATEBIRTH, SD.SDNAME, P.PID AS PID2'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC Sd ON sd.SDID = PS.SDID'
      'WHERE'
      'PR.PID_GROUP = ('
      'SELECT DISTINCT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID'
      ') and P.PISDELETE IS NULL'
      ') AS UN1'
      'WHERE NOT EXISTS ('
      'SELECT UN.*'
      'FROM'
      '('
      
        'SELECT PR.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    PS.SDID, P.PDATEBIRTH, SD.SDNAME, P.PID AS PID2'
      'FROM P_REL PR'
      'INNER JOIN PEOPLE P ON P.PID = PR.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC Sd ON sd.SDID = PS.SDID'
      'WHERE'
      'PR.PID_GROUP = ('
      'SELECT DISTINCT PR1.PID_GROUP'
      'FROM P_REL PR1'
      'WHERE PR1.PID = :PID'
      ') and P.PISDELETE IS NULL'
      ') AS UN'
      
        'INNER JOIN P_VIZIT PV1 ON PV1.PID = UN.PID2 AND PV1.PVTIME_IN < ' +
        'CURRENT_TIMESTAMP AND PV1.PVTIME_OUT IS NULL AND PV1.PVPRIZNAK_I' +
        'N IS NULL AND PV1.PVPRIZNAK_OUT IS NULL'
      'WHERE UN.PID = UN1.PId'
      ')')
    Left = 520
    Top = 584
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object IntegerField8: TIntegerField
      FieldName = 'PRID'
      Origin = '"P_REL"."PRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField9: TIntegerField
      FieldName = 'PID'
      Origin = '"P_REL"."PID"'
    end
    object IntegerField10: TIntegerField
      FieldName = 'PID_GROUP'
      Origin = '"P_REL"."PID_GROUP"'
    end
    object IBStringField11: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object IntegerField11: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
    object DateField3: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object IBStringField12: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object qChekIN: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = dsTemp
    SQL.Strings = (
      'SELECT PV.*,  MAX(PV.PVTIME_IN)'
      'FROM P_VIZIT PV'
      'WHERE PV.PID = :PID'
      '    AND PV.PVTIME_OUT IS NULL'
      'GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12')
    UpdateObject = quChekIN
    Left = 840
    Top = 752
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qChekINMAX: TDateTimeField
      FieldName = 'MAX'
      ProviderFlags = []
    end
    object qChekINPVID: TIntegerField
      FieldName = 'PVID'
      Origin = '"P_VIZIT"."PVID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qChekINPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_VIZIT"."PID"'
    end
    object qChekINPVTARGET: TIntegerField
      FieldName = 'PVTARGET'
      Origin = '"P_VIZIT"."PVTARGET"'
    end
    object qChekINPVTIME_IN: TDateTimeField
      FieldName = 'PVTIME_IN'
      Origin = '"P_VIZIT"."PVTIME_IN"'
    end
    object qChekINPVTIME_OUT: TDateTimeField
      FieldName = 'PVTIME_OUT'
      Origin = '"P_VIZIT"."PVTIME_OUT"'
    end
    object qChekINPVPRIZNAK_IN: TIntegerField
      FieldName = 'PVPRIZNAK_IN'
      Origin = '"P_VIZIT"."PVPRIZNAK_IN"'
    end
    object qChekINPVPRIZNAK_OUT: TIntegerField
      FieldName = 'PVPRIZNAK_OUT'
      Origin = '"P_VIZIT"."PVPRIZNAK_OUT"'
    end
    object qChekINPVNOTE: TIBStringField
      FieldName = 'PVNOTE'
      Origin = '"P_VIZIT"."PVNOTE"'
      Size = 255
    end
    object qChekINPVUSERENTER: TIBStringField
      FieldName = 'PVUSERENTER'
      Origin = '"P_VIZIT"."PVUSERENTER"'
      Size = 40
    end
    object qChekINPVTIMEENTER: TDateTimeField
      FieldName = 'PVTIMEENTER'
      Origin = '"P_VIZIT"."PVTIMEENTER"'
    end
    object qChekINPVUSEREDIT: TIBStringField
      FieldName = 'PVUSEREDIT'
      Origin = '"P_VIZIT"."PVUSEREDIT"'
      Size = 40
    end
    object qChekINPVTIMEEDIT: TDateTimeField
      FieldName = 'PVTIMEEDIT'
      Origin = '"P_VIZIT"."PVTIMEEDIT"'
    end
  end
  object quChekIN: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PVID,'
      '  PID,'
      '  PVTARGET,'
      '  PVTIME_IN,'
      '  PVTIME_OUT,'
      '  PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT,'
      '  PVNOTE,'
      '  PVUSERENTER,'
      '  PVTIMEENTER,'
      '  PVUSEREDIT,'
      '  PVTIMEEDIT,'
      '  MAX'
      'from P_VIZIT '
      'where'
      '  PVID = :PVID')
    ModifySQL.Strings = (
      'update P_VIZIT'
      'set'
      '  PID = :PID,'
      '  PVID = :PVID,'
      '  PVNOTE = :PVNOTE,'
      '  PVPRIZNAK_IN = :PVPRIZNAK_IN,'
      '  PVPRIZNAK_OUT = :PVPRIZNAK_OUT,'
      '  PVTARGET = :PVTARGET,'
      '  PVTIME_IN = :PVTIME_IN,'
      '  PVTIME_OUT = :PVTIME_OUT,'
      '  PVTIMEEDIT = :PVTIMEEDIT,'
      '  PVTIMEENTER = :PVTIMEENTER,'
      '  PVUSEREDIT = :PVUSEREDIT,'
      '  PVUSERENTER = :PVUSERENTER'
      'where'
      '  PVID = :OLD_PVID')
    InsertSQL.Strings = (
      'insert into P_VIZIT'
      
        '  (PID, PVID, PVNOTE, PVPRIZNAK_IN, PVPRIZNAK_OUT, PVTARGET, PVT' +
        'IME_IN, '
      '   PVTIME_OUT, PVTIMEEDIT, PVTIMEENTER, PVUSEREDIT, PVUSERENTER)'
      'values'
      
        '  (:PID, :PVID, :PVNOTE, :PVPRIZNAK_IN, :PVPRIZNAK_OUT, :PVTARGE' +
        'T, :PVTIME_IN, '
      
        '   :PVTIME_OUT, :PVTIMEEDIT, :PVTIMEENTER, :PVUSEREDIT, :PVUSERE' +
        'NTER)')
    DeleteSQL.Strings = (
      'delete from P_VIZIT'
      'where'
      '  PVID = :OLD_PVID')
    Left = 872
    Top = 754
  end
  object qGenGr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dsTemp
    SQL.Strings = (
      'SELECT GEN_ID(GEN_P_REL_GROUP,1) FROM rdb$database')
    Left = 1248
    Top = 680
    object qGenGrGEN_ID: TLargeintField
      FieldName = 'GEN_ID'
      ProviderFlags = []
    end
  end
end
